﻿//内存定义
using System;

public unsafe class memory_t
{
	//内存缓冲
	public byte[] buffer;
	//内存大小
	public uint memSize;

	public byte* bufferP;

    public int WaitCycles = 1;

    internal unsafe uint ReadU8(uint v)
    {
        return GlobalMembers.mem_ld8(this, v);
    }

    internal unsafe ushort ReadU16(uint v)
    {
        return GlobalMembers.mem_ld16(this, v);
    }

    internal unsafe uint ReadU32Aligned(uint v)
    {
        return GlobalMembers.mem_ld32(this, v);
    }

    internal unsafe uint ReadU32(uint v)
    {
        return GlobalMembers.mem_ld32(this, v);
    }

    internal unsafe void WriteU32(uint v1, uint v2)
    {
        GlobalMembers.mem_st32(this,v1, v2);
    }

    internal unsafe void WriteU16(uint v1, ushort v2)
    {
        GlobalMembers.mem_st16(this, v1, v2);
    }

    internal unsafe void WriteU8(uint v1, byte v2)
    {
        GlobalMembers.mem_st8(this, v1, v2);
    }

    
}